<template>
  <s-table size="default" ref="table" rowKey="userId" :rowSelection="null" :columns="columns" :data="loadData">
    <!-- 序号 -->
    <span slot="serial" slot-scope="text, record, index">
      {{ parseInt(index) }}
    </span>
    <span slot="action" slot-scope="text, record">
      <template>
        <a @click="delById(record.id)">查看</a>
      </template>
    </span>
  </s-table>
</template>

<script>
import { STable } from '@/components'
import { accessoryPageList } from '@/api/member/member'

export default {
  components: {
    STable
  },
  data() {
    return {
      // 表头
      columns: [
        {
          title: '序号',
          scopedSlots: { customRender: 'serial' },
          width: 100
        },
        {
          title: '表单名称',
          dataIndex: 'name'
        },
        {
          title: '填写人',
          dataIndex: 'userInfo'
        },
        {
          title: '填写时间',
          dataIndex: 'createTime'
        },
        {
          title: '操作',
          width: '150px',
          fixed: 'right',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' }
        }
      ],
      // 加载数据方法 必须为 Promise 对象
      loadData: parameter => {
        var params = {
          current: parameter.pageNum,
          size: parameter.pageSize
        }
        return accessoryPageList(Object.assign(params))
      }
    }
  }
}
</script>

<style lang="less" scoped></style>
